home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3371 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1012 b 

  1. Path: news.NetVision.net.il!news
  2. From: iti@Jerusalem.netvision.net.il
  3. Newsgroups: comp.os.ms-windows.programmer.tools.mfc,comp.os.ms-windows.apps.compatibility.win95,comp.lang.c++
  4. Subject: HELP !!! Memory - Allocation
  5. Date: Tue, 23 Jan 96 16:29:28 PDT
  6. Organization: NetVision LTD.
  7. Message-ID: <NEWTNews.751.822443462.Postmaster@Jerusalem.netvision.net.il>
  8. NNTP-Posting-Host: ts2cp10.netvision.net.il
  9. Mime-Version: 1.0
  10. Content-Type: TEXT/PLAIN; charset=US-ASCII
  11. X-Newsreader: NEWTNews & Chameleon -- TCP/IP for MS Windows from NetManage
  12.  
  13.  
  14.  
  15. I am using Visual C++ to write a Windows Application - and I am having
  16. a memory problem. I want to dynamically allocate "nTemp" bytes of memory
  17. to read in a char string, or the most memory available up to "nTemp" 
  18. bytes.  
  19.  
  20. My questions being:
  21.     1. How can I most efficiantly do this?
  22.     2. Should I use 
  23.             -> pChar = (char*) malloc(nTemp); Or
  24.             -> pChar = new char[nTemp];
  25.  
  26. Please send any advice you have for me to my EMail address:
  27.     iti@netvision.net.il
  28.  
  29. Thanks
  30. Yaakov
  31.  
  32.  
  33.